<!Doctype html>
<html>
<head>
    <meta charset="utf-8" />
    <script type="text/javascript" src="preact.min.js"></script>
    <script type="text/javascript" src="preact.hooks.min.js"></script>
</head>
<body>
<div id="root"></div>
</body>


<script type="text/javascript">
const { h, render } = preact;
const { useState } = preactHooks;

const App = (props) => {
    const [input, setInput] = useState("");
    return h(
        "div",
        null,
        h("h1", null, props.title, input),
        h("p", null, 'Do you agree to the statement: "Preact is awesome"? ', input),
        h("input", { value: input, onInput: (e) => setInput(e.target.value) })
    );
};

preact.render(
  h(App, { title: "标题" }), document.getElementById("root") );
</script>
</html>
